{% extends 'base_with_top_menu.html' %}

{% block title %}Book list{% endblock %}

{% block header %}Book list{% endblock %}

{% block content %}
<div class='content_form'>
<form action='.' method='post'>
    <table>
        <tr>
            <td>Title: </td>
            <td><input type='text' name='title' value=''></td>
        </tr><tr>
        <tr>
            <td>Author: </td>
            <td><input type='text' name='author' value=''></td>
        </tr><tr>
        <tr>
            <td>Category: </td>
            <td><input type='text' name='category' value=''></td>
        </tr><tr>
            <td></td><td>
                <input type='submit' name='action' value='Search'>
                 | <input type='submit' name='action' value='List all'>
            </td></tr>
    </table>
</form>
</div>
<div>
<ul class='booklist'>
{% for book in books %}
<li><b><a href='{{ book.url }}'>{{ book.title }}:</a></b>
{% if book.authors %}
 {{ book.authors|join:', '}}
{% else %}
 no authors
{% endif %}
</li>
{% empty %}
<b>Sorry, no books.</b>
{% endfor %}
</ul>
</div>
{% endblock %}